CFLAGS = -Wall -c

all: pong.exe

pong.exe: video-graphics.o tabuleiro.o main.o sprite.o codepage.o ass.o ints.o timer.o music.o intasm.o queue.o rtc.o gqueue.o
	gcc video-graphics.o tabuleiro.o sprite.o codepage.o ass.o ints.o timer.o music.o intasm.o queue.o rtc.o gqueue.o main.o -o pong.exe

main.o: main.c video-graphics.c video-graphics.h tabuleiro.h tabuleiro.c sprite.o codepage.o
	gcc $(CFLAGS) main.c
	
video-graphics.o: video-graphics.h video-graphics.c utypes.h
	gcc $(CFLAGS) video-graphics.c

tabuleiro.o: video-graphics.c video-graphics.h tabuleiro.c tabuleiro.h 
	gcc $(CFLAGS) tabuleiro.c

sprite.o: sprite2.h sprite2.c read_xpm.c
	gcc -Wall -c sprite2.c -o sprite.o
	
codepage.o: codepage.h codepage.c
	gcc -Wall -c codepage.c -o codepage.o
	
rtc.o: rtc.h rtc.c utypes.h
	gcc -c rtc.c -o rtc.o

ints.o: ints.c ints.h
	gcc -c ints.c

ass.o: ass.asm
	nasm -f coff ass.asm -o ass.o
	
music.o: music.h timer.h
	gcc -c music.c
	
timer.o: timer.h
	gcc -c timer.c
	
intasm.o: intasm.asm
	nasm -f coff intasm.asm -o intasm.o
	
queue.o: queue.h timer.h music.h
	gcc -c queue.c
	
gqueue.o: gqueue.h gqueue.c
	gcc -c gqueue.c -o gqueue.o
#main.o: main.c video-graphics.c video-graphics.h sprite.h sprite.c
#	gcc $(CFLAGS) main.c	
	
#tp02.exe: video-graphics.o main.o sprite.o
#	gcc video-graphics.o main.o sprite.o -o tp02.exe
	
#video-graphics.o: video-graphics.h video-graphics.c sprite.h utypes.h
#	gcc $(CFLAGS) video-graphics.c
	
#sprite.o: sprite.h sprite.c
#	gcc $(CFLAGS) sprite.c

clean:
	rm -f *.o
	rm -f *.exe